<?php 
class sitemapDAO extends CI_Model {

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
        $this->load->library("sitemap");
    }
    
    function save($page='index',$data = array('url'=> array('url'=>'', 'lastmod'=>'', 'changefreq'=>'daily', 'priority'=>'1.0')))
    {
	$this->sitemap->page($page); 
	
	foreach($data as $url)
	  $this->sitemap->url($url->url,(isset($url->lastmod) ? $url->lastmod : ''),(isset($url->changefreq) ? $url->changefreq : 'daily'),(isset($url->priority) ? $url->priority : '1.0')); 

	$this->sitemap->close();
        unset ($this->sitemap); 
    }
    
}
?>    